// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_c;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import android.text.TextUtils;
import com.nnee.p_g.cls_b;
import com.nnee.p_pr.p_app.cls_e;
import com.nnee.p_pr.p_atom.cls_aa;
import com.nnee.p_pr.p_atom.cls_o;
import com.nnee.p_pr.p_atom.cls_r;
import com.nnee.p_pr.p_atom.cls_u;
import com.nnee.p_pr.p_prot.cls_a;
import com.nnee.p_pr.p_prot.cls_d;
import com.nnee.p_pr.p_prot.cls_h;
import com.nnee.p_pr.p_prov.cls_ac;
import com.nnee.p_pr.p_prov.m;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

// Referenced classes of package com.nnee.p_pr.c:
//            n, j, k

public class cls_c
{

    public cls_c()
    {
    }

    public static int a(Context context, String s)
    {
        if(context == null) goto _L2; else goto _L1
_L1:
        Cursor cursor;
        ContentResolver contentresolver = context.getContentResolver();
        android.net.Uri uri = m.k;
        String as[] = c;
        String as1[] = new String[1];
        as1[0] = s;
        cursor = contentresolver.query(uri, as, "account = ?", as1, null);
        if(cursor == null) goto _L4; else goto _L3
_L3:
        if(!cursor.moveToFirst()) goto _L4; else goto _L5
_L5:
        int j1 = cursor.getInt(0);
        int i1;
        i1 = j1;
        if(cursor != null)
            cursor.close();
_L7:
        return i1;
_L4:
        if(cursor != null)
            cursor.close();
_L2:
        i1 = 0;
        if(true) goto _L7; else goto _L6
_L6:
        Exception exception1;
        exception1;
        exception1.printStackTrace();
        if(cursor != null)
            cursor.close();
          goto _L2
        Exception exception;
        exception;
        if(cursor != null)
            cursor.close();
        throw exception;
    }

    public static LinkedList a(Context context, String s, boolean flag)
    {
        LinkedList linkedlist;
        Cursor cursor;
        linkedlist = null;
        String s1 = (new StringBuilder()).append(" (account = '").append(s).append("'").append(" ) OR ").append("type").append(" = ").append(m.o).toString();
        cursor = context.getContentResolver().query(m.k, b, s1, linkedlist, " seq ASC");
        if(cursor != null) goto _L2; else goto _L1
_L1:
        return linkedlist;
_L2:
        if(!cursor.moveToFirst()) goto _L4; else goto _L3
_L3:
        LinkedList linkedlist1;
        int i1;
        linkedlist1 = new LinkedList();
        i1 = 0;
_L9:
        String s2;
        int j1;
        long l1;
        s2 = cursor.getString(8);
        j1 = cursor.getInt(6);
        l1 = cursor.getLong(9);
        if(s2 != null) goto _L6; else goto _L5
_L5:
        int k1 = i1;
_L10:
        boolean flag1 = cursor.moveToNext();
        if(flag1) goto _L8; else goto _L7
_L7:
        if(cursor != null)
            cursor.close();
        linkedlist = linkedlist1;
          goto _L1
_L6:
        if(!flag)
            break MISSING_BLOCK_LABEL_209;
        a(linkedlist1, s2, j1, l1);
        if(linkedlist1.size() > 0)
            ((u)linkedlist1.getLast()).c();
        break MISSING_BLOCK_LABEL_342;
        cls_u u1 = new cls_u();
        u1.b(j1);
        u1.b(l1);
        u1.d(false);
        u1.q(cursor.getString(2));
        u1.a("title", cursor.getString(4));
        if(u1.V() != null)
            linkedlist1.add(u1);
        break MISSING_BLOCK_LABEL_342;
        Exception exception1;
        exception1;
        if(cursor != null)
            cursor.close();
          goto _L1
_L4:
        if(cursor != null)
            cursor.close();
          goto _L1
        Exception exception;
        exception;
        if(cursor != null)
            cursor.close();
        throw exception;
_L8:
        i1 = k1;
          goto _L9
        k1 = i1 + 1;
          goto _L10
    }

    public static void a(Context context, cls_u u1)
    {
        if(context != null && u1 != null && !TextUtils.isEmpty(u1.V()))
        {
            long l1 = System.currentTimeMillis();
            ContentValues contentvalues = new ContentValues();
            contentvalues.put("refresh", Long.valueOf(l1));
            ContentResolver contentresolver = context.getContentResolver();
            android.net.Uri uri = m.k;
            String as[] = new String[1];
            as[0] = u1.V();
            contentresolver.update(uri, contentvalues, "uid= ?", as);
            u1.b(l1);
        }
    }

    public static void a(Context context, String s, cls_u u1)
    {
        if(context != null && !TextUtils.isEmpty(s) && u1 != null) goto _L2; else goto _L1
_L1:
        return;
_L2:
        long l1 = System.currentTimeMillis();
        ContentValues contentvalues = new ContentValues();
        contentvalues.put("account", s);
        contentvalues.put("uid", u1.V());
        contentvalues.put("updated", u1.Y());
        contentvalues.put("title", u1.U());
        contentvalues.put("type", Integer.valueOf(m.n));
        contentvalues.put("content", u1.toString());
        u1.b(1 + a(context, s));
        contentvalues.put("seq", Integer.valueOf(u1.h()));
        context.getContentResolver().insert(m.k, contentvalues);
        contentvalues.clear();
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("addSubscribeItem  time is:").append(System.currentTimeMillis() - l1).toString());
        if(true) goto _L1; else goto _L3
_L3:
    }

    public static void a(Context context, String s, String s1)
    {
        long l1 = System.currentTimeMillis();
        String s2 = (new StringBuilder()).append("account = '").append(s).append("' AND ").append("uid").append(" = '").append(s1).append("'").append("  AND  ").append("type").append(" = ").append(m.n).toString();
        context.getContentResolver().delete(m.k, s2, null);
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("deleteSubscribeItem time is:").append(System.currentTimeMillis() - l1).toString());
    }

    public static void a(Context context, String s, String s1, boolean flag)
    {
        com.nnee.p_pr.c.n.a(context, s, s1, flag);
    }

    public static void a(Context context, String s, ArrayList arraylist)
    {
        com.nnee.p_pr.c.n.a(context, arraylist, s);
    }

    public static void a(Context context, String s, Collection collection)
    {
        if(collection != null && collection.size() > 0)
        {
            StringBuilder stringbuilder = new StringBuilder();
            stringbuilder.append("account").append(" = '").append(s).append("'").append("  AND ").append("type").append(" = ").append(m.n);
            stringbuilder.append(" AND ").append("uid").append(" IN (");
            cls_u u1;
            for(Iterator iterator = collection.iterator(); iterator.hasNext(); stringbuilder.append("'").append(u1.V()).append("'").append(","))
                u1 = (cls_u)iterator.next();

            stringbuilder.deleteCharAt(-1 + stringbuilder.length());
            stringbuilder.append(')');
            context.getContentResolver().delete(m.k, stringbuilder.toString(), null);
        }
    }

    public static void a(Context context, String s, LinkedList linkedlist)
    {
        SQLiteStatement sqlitestatement = null;
        if(linkedlist != null && linkedlist.size() > 0) goto _L2; else goto _L1
_L1:
        return;
_L2:
        long l1;
        SQLiteDatabase sqlitedatabase;
        l1 = System.currentTimeMillis();
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("addSubscribe  size is:").append(linkedlist.size()).toString());
        sqlitedatabase = ac.a(context).getWritableDatabase();
        sqlitedatabase.beginTransaction();
        StringBuilder stringbuilder;
        SQLiteStatement sqlitestatement2;
        stringbuilder = new StringBuilder();
        stringbuilder.append(" INSERT OR REPLACE INTO ");
        stringbuilder.append("subscribe");
        stringbuilder.append("(");
        stringbuilder.append("account");
        stringbuilder.append(",");
        stringbuilder.append("uid");
        stringbuilder.append(",");
        stringbuilder.append("updated");
        stringbuilder.append(",");
        stringbuilder.append("title");
        stringbuilder.append(",");
        stringbuilder.append("content");
        stringbuilder.append(",");
        stringbuilder.append("type");
        stringbuilder.append(",");
        stringbuilder.append("seq");
        stringbuilder.append(",");
        stringbuilder.append("refresh");
        stringbuilder.append(")");
        stringbuilder.append(" VALUES(");
        stringbuilder.append("?,?,?,?,?,?,?,?");
        stringbuilder.append(");");
        sqlitestatement2 = sqlitedatabase.compileStatement(stringbuilder.toString());
        SQLiteStatement sqlitestatement1 = sqlitestatement2;
        Iterator iterator;
        stringbuilder.setLength(0);
        stringbuilder.append(" UPDATE ");
        stringbuilder.append("subscribe");
        stringbuilder.append(" SET ");
        stringbuilder.append("seq");
        stringbuilder.append(" =? ");
        stringbuilder.append(" WHERE ");
        stringbuilder.append("account");
        stringbuilder.append(" =? ");
        stringbuilder.append(" AND ");
        stringbuilder.append("uid");
        stringbuilder.append(" =? ");
        sqlitestatement = sqlitedatabase.compileStatement(stringbuilder.toString());
        iterator = linkedlist.iterator();
_L6:
        if(!iterator.hasNext()) goto _L4; else goto _L3
_L3:
        cls_u u1 = (cls_u)iterator.next();
        if("-1".equals(u1.V())) goto _L6; else goto _L5
_L5:
        if(u1.w()) goto _L8; else goto _L7
_L7:
        b(sqlitedatabase, u1, s, sqlitestatement1);
          goto _L6
        Exception exception;
        exception;
_L11:
        exception.printStackTrace();
        if(sqlitestatement != null)
            sqlitestatement.close();
        if(sqlitestatement1 != null)
            sqlitestatement1.close();
        sqlitedatabase.endTransaction();
_L9:
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("addSubscribe  time is:").append(System.currentTimeMillis() - l1).toString());
          goto _L1
_L8:
        a(sqlitedatabase, u1, s, sqlitestatement);
          goto _L6
        Exception exception1;
        exception1;
_L10:
        if(sqlitestatement != null)
            sqlitestatement.close();
        if(sqlitestatement1 != null)
            sqlitestatement1.close();
        sqlitedatabase.endTransaction();
        throw exception1;
_L4:
        sqlitedatabase.setTransactionSuccessful();
        if(sqlitestatement != null)
            sqlitestatement.close();
        if(sqlitestatement1 != null)
            sqlitestatement1.close();
        sqlitedatabase.endTransaction();
          goto _L9
        exception1;
        sqlitestatement1 = sqlitestatement;
          goto _L10
        exception;
        sqlitestatement1 = sqlitestatement;
          goto _L11
    }

    public static void a(Context context, HashMap hashmap, String s)
    {
        if(context != null && hashmap != null && hashmap.size() != 0 && !TextUtils.isEmpty(s)) goto _L2; else goto _L1
_L1:
        return;
_L2:
        SQLiteDatabase sqlitedatabase;
        SQLiteStatement sqlitestatement;
        sqlitedatabase = ac.a(context).getWritableDatabase();
        sqlitedatabase.beginTransaction();
        sqlitestatement = null;
        SQLiteStatement sqlitestatement1;
        StringBuilder stringbuilder = new StringBuilder();
        stringbuilder.append(" UPDATE ");
        stringbuilder.append("subscribe");
        stringbuilder.append(" SET ");
        stringbuilder.append("seq");
        stringbuilder.append(" =? WHERE ");
        stringbuilder.append("account");
        stringbuilder.append(" =? AND ");
        stringbuilder.append("uid");
        stringbuilder.append(" =?");
        sqlitestatement1 = sqlitedatabase.compileStatement(stringbuilder.toString());
        for(Iterator iterator = hashmap.entrySet().iterator(); iterator.hasNext(); sqlitestatement1.execute())
        {
            java.util.Map.Entry entry = (java.util.Map.Entry)iterator.next();
            sqlitestatement1.bindLong(1, ((Integer)entry.getValue()).intValue());
            sqlitestatement1.bindString(2, s);
            sqlitestatement1.bindString(3, (String)entry.getKey());
        }

          goto _L3
        Exception exception;
        exception;
        sqlitestatement = sqlitestatement1;
_L6:
        exception.printStackTrace();
        if(sqlitestatement != null)
            sqlitestatement.close();
        sqlitedatabase.endTransaction();
          goto _L1
_L3:
        sqlitedatabase.setTransactionSuccessful();
        if(sqlitestatement1 != null)
            sqlitestatement1.close();
        sqlitedatabase.endTransaction();
          goto _L1
        Exception exception1;
        exception1;
_L5:
        if(sqlitestatement != null)
            sqlitestatement.close();
        sqlitedatabase.endTransaction();
        throw exception1;
        exception1;
        sqlitestatement = sqlitestatement1;
        if(true) goto _L5; else goto _L4
_L4:
        exception;
          goto _L6
    }

    private static void a(SQLiteDatabase sqlitedatabase, cls_u u1, String s, SQLiteStatement sqlitestatement)
    {
        if(sqlitedatabase != null && u1 != null) goto _L2; else goto _L1
_L1:
        return;
_L2:
        sqlitestatement.bindLong(1, u1.h());
        if(s == null) goto _L4; else goto _L3
_L3:
        sqlitestatement.bindString(2, s);
_L5:
        if(u1.V() == null)
            break MISSING_BLOCK_LABEL_75;
        sqlitestatement.bindString(3, u1.V());
_L6:
        sqlitestatement.execute();
          goto _L1
        Exception exception1;
        exception1;
        exception1.printStackTrace();
          goto _L1
        Exception exception;
        exception;
        throw exception;
_L4:
        sqlitestatement.bindNull(2);
          goto _L5
        sqlitestatement.bindNull(3);
          goto _L6
    }

    public static void a(cls_d d1)
    {
        if(d1 != null && d1.h != null)
        {
            for(Iterator iterator = d1.h.iterator(); iterator.hasNext(); ((cls_u)iterator.next()).a(aa.a));
        }
    }

    public static void a(cls_d d1, String s)
    {
        if(d1.h.size() != 0) goto _L2; else goto _L1
_L1:
        return;
_L2:
        LinkedList linkedlist = d1.h;
        HashMap hashmap = new HashMap();
        StringBuilder stringbuilder = new StringBuilder();
        Iterator iterator = linkedlist.iterator();
        do
        {
            if(!iterator.hasNext())
                break;
            u u2 = (cls_u)iterator.next();
            if(u2 != null && u2.al())
            {
                hashmap.put(u2.V(), u2);
                stringbuilder.append("'").append(u2.V()).append("'").append(",");
            }
        } while(true);
        if(hashmap.size() != 0)
        {
            if(stringbuilder.length() > 0)
                stringbuilder.deleteCharAt(-1 + stringbuilder.length());
            Cursor cursor = b(com.nnee.p_b.p_a.cls_d.h().a(), s, stringbuilder.toString());
            if(cursor != null)
            {
                if(cursor.moveToFirst())
                    do
                    {
                        cls_u u1 = (u)hashmap.remove(cursor.getString(2));
                        if(u1 != null)
                            u1.a(aa.a);
                    } while(cursor.moveToNext());
                for(Iterator iterator1 = hashmap.values().iterator(); iterator1.hasNext(); ((cls_u)iterator1.next()).a(aa.b));
                if(cursor != null)
                    cursor.close();
            }
        }
        if(true) goto _L1; else goto _L3
_L3:
    }

    private static void a(LinkedList linkedlist, String s, int i1, long l1)
    {
        (new cls_h(new cls_a(new cls_j(i1, l1, linkedlist)))).a(com.nnee.p_pr.p_a.cls_e.a(s));
_L1:
        return;
        Exception exception;
        exception;
        exception.printStackTrace();
          goto _L1
    }

    public static Cursor b(Context context, String s, String s1)
    {
        String s2 = null;
        if(context != null && !TextUtils.isEmpty(s) && s1 != null)
        {
            String s3 = (new StringBuilder()).append("account = '").append(s).append("' AND ").append("uid").append(" in ").append("(").append(s1).append(")").toString();
            s2 = context.getContentResolver().query(m.k, b, s3, s2, s2);
        }
        return s2;
    }

    public static cls_u b(Context context, String s, cls_u u1)
    {
        if(u1 != null && u1.w() && u1.V() != null) goto _L2; else goto _L1
_L1:
        u u2 = u1;
_L4:
        return u2;
_L2:
        Cursor cursor;
        ContentResolver contentresolver = context.getContentResolver();
        android.net.Uri uri = m.k;
        String as[] = b;
        String as1[] = new String[2];
        as1[0] = s;
        as1[1] = u1.V();
        cursor = contentresolver.query(uri, as, "account = ? and uid = ?", as1, " seq ASC");
        if(cursor == null)
        {
            u2 = null;
            continue; /* Loop/switch isn't completed */
        }
        if(!cursor.moveToFirst())
            break MISSING_BLOCK_LABEL_168;
        LinkedList linkedlist = new LinkedList();
        a(linkedlist, cursor.getString(8), cursor.getInt(6), cursor.getLong(9));
        if(linkedlist.size() <= 0)
            break MISSING_BLOCK_LABEL_168;
        u2 = (u)linkedlist.getFirst();
        if(cursor != null)
            cursor.close();
        continue; /* Loop/switch isn't completed */
        if(cursor != null)
            cursor.close();
_L5:
        u2 = null;
        if(true) goto _L4; else goto _L3
_L3:
        Exception exception1;
        exception1;
        if(cursor != null)
            cursor.close();
          goto _L5
        Exception exception;
        exception;
        if(cursor != null)
            cursor.close();
        throw exception;
    }

    public static List b(Context context, String s)
    {
        Object obj;
        Cursor cursor;
        obj = null;
        ContentResolver contentresolver = context.getContentResolver();
        android.net.Uri uri = m.k;
        String as[] = new String[1];
        as[0] = "uid";
        String as1[] = new String[1];
        as1[0] = s;
        cursor = contentresolver.query(uri, as, "account= ?", as1, ((String) (obj)));
        if(cursor == null) goto _L2; else goto _L1
_L1:
        if(!cursor.moveToFirst()) goto _L2; else goto _L3
_L3:
        LinkedList linkedlist = new LinkedList();
        boolean flag;
        do
        {
            String s1 = cursor.getString(0);
            if(s1 != null && !linkedlist.contains(s1))
                linkedlist.add(s1);
            flag = cursor.moveToNext();
        } while(flag);
        if(cursor != null)
            cursor.close();
        obj = linkedlist;
_L5:
        return ((List) (obj));
_L2:
        if(cursor != null)
            cursor.close();
        continue; /* Loop/switch isn't completed */
        Exception exception1;
        exception1;
        exception1.printStackTrace();
        if(cursor != null)
            cursor.close();
        if(true) goto _L5; else goto _L4
_L4:
        Exception exception;
        exception;
        if(cursor != null)
            cursor.close();
        throw exception;
    }

    public static void b(Context context, String s, LinkedList linkedlist)
    {
        if(linkedlist != null && linkedlist.size() > 0) goto _L2; else goto _L1
_L1:
        return;
_L2:
        int i1 = linkedlist.size();
        long l1 = System.currentTimeMillis();
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("deleteSubscribeByEntry size is:").append(i1).toString());
        StringBuilder stringbuilder = new StringBuilder();
        for(int j1 = 0; j1 < i1; j1++)
        {
            cls_u u1 = (u)linkedlist.get(j1);
            if(u1 != null)
            {
                stringbuilder.append("'");
                stringbuilder.append(u1.V());
                stringbuilder.append("'");
                stringbuilder.append(",");
            }
        }

        if(stringbuilder.length() > 0)
            stringbuilder.deleteCharAt(-1 + stringbuilder.length());
        String s1 = (new StringBuilder()).append("account  = '").append(s).append("'").append(" AND ").append("uid").append(" in ").append(" (").append(stringbuilder.toString()).append(" )").toString();
        context.getContentResolver().delete(m.k, s1, null);
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("deleteSubscribeByEntry time is:").append(System.currentTimeMillis() - l1).toString());
        if(true) goto _L1; else goto _L3
_L3:
    }

    private static void b(SQLiteDatabase sqlitedatabase, cls_u u1, String s, SQLiteStatement sqlitestatement)
    {
        if(sqlitedatabase != null && u1 != null) goto _L2; else goto _L1
_L1:
        return;
_L2:
        long l1 = System.currentTimeMillis();
        if(s == null) goto _L4; else goto _L3
_L3:
        sqlitestatement.bindString(1, s);
_L9:
        if(u1.V() == null) goto _L6; else goto _L5
_L5:
        sqlitestatement.bindString(2, u1.V());
_L11:
        if(u1.Y() == null) goto _L8; else goto _L7
_L7:
        sqlitestatement.bindString(3, u1.Y());
_L12:
        if(u1.U() == null)
            break MISSING_BLOCK_LABEL_235;
        sqlitestatement.bindString(4, u1.U());
_L13:
        long l2 = System.currentTimeMillis();
        sqlitestatement.bindString(5, u1.toString());
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("addSubscribe2DB write content time is:").append(System.currentTimeMillis() - l2).toString());
        sqlitestatement.bindLong(6, m.n);
        sqlitestatement.bindLong(7, u1.h());
        sqlitestatement.bindLong(8, u1.bk());
        sqlitestatement.execute();
_L10:
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("addSubscribe2DB time is:").append(System.currentTimeMillis() - l1).toString());
          goto _L1
_L4:
        sqlitestatement.bindNull(1);
          goto _L9
        Exception exception1;
        exception1;
        exception1.printStackTrace();
          goto _L10
        Exception exception;
        exception;
        throw exception;
_L6:
        sqlitestatement.bindNull(2);
          goto _L11
_L8:
        sqlitestatement.bindNull(3);
          goto _L12
        sqlitestatement.bindNull(4);
          goto _L13
    }

    public static void c(Context context, String s, cls_u u1)
    {
        if(u1 != null) goto _L2; else goto _L1
_L1:
        return;
_L2:
        long l1 = System.currentTimeMillis();
        a(context, s, u1);
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("updateSubscribe time is:").append(System.currentTimeMillis() - l1).toString());
        if(true) goto _L1; else goto _L3
_L3:
    }

    public static void c(Context context, String s, LinkedList linkedlist)
    {
        if(linkedlist != null && linkedlist.size() > 0) goto _L2; else goto _L1
_L1:
        return;
_L2:
        int i1 = linkedlist.size();
        long l1 = System.currentTimeMillis();
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("deleteSubscribeByOk size is:").append(i1).toString());
        StringBuilder stringbuilder = new StringBuilder();
        for(int j1 = 0; j1 < i1; j1++)
        {
            cls_o o1 = (o)linkedlist.get(j1);
            if(o1 != null)
            {
                stringbuilder.append("'");
                stringbuilder.append(o1.a());
                stringbuilder.append("'");
                stringbuilder.append(",");
            }
        }

        if(stringbuilder.length() > 0)
            stringbuilder.deleteCharAt(-1 + stringbuilder.length());
        String s1 = (new StringBuilder()).append("account  = '").append(s).append("'").append(" AND ").append("uid").append(" in ").append(" (").append(stringbuilder.toString()).append(" )").toString();
        context.getContentResolver().delete(m.k, s1, null);
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("deleteSubscribeByOk time is:").append(System.currentTimeMillis() - l1).toString());
        if(true) goto _L1; else goto _L3
_L3:
    }

    public static boolean c(Context context, String s)
    {
        String s1 = (new StringBuilder()).append("account = '").append(s).append("'").append(" AND ").append("type").append(" = ").append(m.n).toString();
        Cursor cursor = context.getContentResolver().query(m.k, b, s1, null, null);
        boolean flag;
        if(cursor == null || !cursor.moveToFirst())
        {
            if(cursor != null)
                cursor.close();
            flag = false;
        } else
        {
            cursor.close();
            flag = true;
        }
        return flag;
    }

    public static boolean c(Context context, String s, String s1)
    {
        return com.nnee.p_pr.c.n.b(context, s, s1);
    }

    public static void d(Context context, String s)
    {
        n.c(context, s);
    }

    public static void d(Context context, String s, LinkedList linkedlist)
    {
        if(linkedlist != null && linkedlist.size() > 0) goto _L2; else goto _L1
_L1:
        return;
_L2:
        int i1 = linkedlist.size();
        long l1 = System.currentTimeMillis();
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("updateSubscribe size is:").append(i1).toString());
        a(context, s, linkedlist);
        if(e.e)
            com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("updateSubscribe time is:").append(System.currentTimeMillis() - l1).toString());
        if(true) goto _L1; else goto _L3
_L3:
    }

    public static int e(Context context, String s)
    {
        return com.nnee.p_pr.c.n.b(context, s);
    }

    public static void e(Context context, String s, LinkedList linkedlist)
    {
        if(linkedlist != null && linkedlist.size() > 0) goto _L2; else goto _L1
_L1:
        return;
_L2:
        int i1 = linkedlist.size();
        StringBuilder stringbuilder = new StringBuilder();
        int j1 = 0;
        do
        {
            if(j1 >= i1)
                break;
            r r1 = (r)linkedlist.get(j1);
            if(r1 != null && r1.f() != 101 && r1.f() == 102)
            {
                stringbuilder.append("'");
                stringbuilder.append(r1.d());
                stringbuilder.append("'");
                stringbuilder.append(",");
            }
            j1++;
        } while(true);
        if(stringbuilder.length() > 0)
            stringbuilder.deleteCharAt(-1 + stringbuilder.length());
        String s1 = (new StringBuilder()).append("account  = '").append(s).append("'").append(" AND ").append("uid").append(" in ").append(" (").append(stringbuilder.toString()).append(" )").toString();
        context.getContentResolver().delete(m.k, s1, null);
        if(true) goto _L1; else goto _L3
_L3:
    }

    public static LinkedList f(Context context, String s)
    {
        long l1 = System.currentTimeMillis();
        String s1 = (new StringBuilder()).append("account  = '").append(s).append("' AND ").append("subscribe").append(".").append("uid").append(" in (").append(" select ").append("uid").append(" from ").append("offline").append(" where ").append("account").append(" = '").append(s).append("'").append(" )").toString();
        Cursor cursor = context.getContentResolver().query(m.k, null, s1, null, " seq ASC");
        LinkedList linkedlist;
        if(cursor == null || !cursor.moveToFirst())
        {
            if(cursor != null)
                cursor.close();
            linkedlist = new LinkedList();
        } else
        {
            LinkedList linkedlist1 = new LinkedList();
            int i1 = 0;
            do
            {
                String s2 = cursor.getString(cursor.getColumnIndex("content"));
                if(s2 != null)
                {
                    try
                    {
                        (new cls_h(new cls_a(new cls_k(linkedlist1)))).a(com.nnee.p_pr.p_a.cls_e.a(s2));
                    }
                    catch(Exception exception)
                    {
                        exception.printStackTrace();
                    }
                    i1++;
                }
            } while(cursor.moveToNext());
            cursor.close();
            if(e.e)
                com.nnee.p_g.cls_b.e("ManagerSubcribe", (new StringBuilder()).append("loadAllSubscribe size is: ").append(i1).append(" time is:").append(System.currentTimeMillis() - l1).toString());
            linkedlist = linkedlist1;
        }
        return linkedlist;
    }

    static final String a = "ManagerSubcribe";
    static String b[];
    static String c[];
    public static final int d = 0;
    public static final int e = 1;
    public static final int f = 2;
    public static final int g = 3;
    public static final int h = 4;
    public static final int i = 5;
    public static final int j = 6;
    public static final int k = 7;
    public static final int l = 8;
    public static final int m = 9;

    static 
    {
        String as[] = new String[10];
        as[0] = "_id";
        as[1] = "account";
        as[2] = "uid";
        as[3] = "updated";
        as[4] = "title";
        as[5] = "type";
        as[6] = "seq";
        as[7] = "other";
        as[8] = "content";
        as[9] = "refresh";
        b = as;
        String as1[] = new String[1];
        as1[0] = "MAX(seq) AS max_seq";
        c = as1;
    }
}
